use "RR_Funding.dta", clear




**** Figure 2: Determinants of Funding Outcomes
********************************************************************************
********************************************************************************

**** Panel A: Y = Pr(Fund)
twoway (line cpi_prob zcpi if zcpi>-4, sort lwidth(thick) lpattern(dash) lcolor(cranberry))(line d12t50c_prob zd12t50c if zd12t50c<4, lcolor(sea) lpattern("_-") sort lwidth(thick)) (line urban_prob zurban if zurban<5, lcolor(538o) lpattern(solid) sort lwidth(thick)) (line afAcre_prob zafAcre if zafAcre<4, lpattern(solid) lcolor(green) sort lwidth(thick)), xlabel(-4(2)4, labsize(medium) notick) ylabel(0(.2)1, labsize(medium) notick) ytitle("Pr(Funding)", size(huge)) xtitle("Standard Deviations", size(huge)) legend(ring(0) position(11) col(1) region(color(none)) label(1 "Congressional Power Index") label(2 "Water Shortage") label(3 "Urbanization Rate") label(4 "AF/Acre") order(1 3 2 4) symxsize(5) size(vlarge) bmargin(2 0 0 7)) xsize(20) ysize(20) graphregion(margin(zero)) saving(fundpr, replace) title("(A)", ring(0) pos(11) margin(2 0 0 2) size(vlarge)) fxsize(100) fysize(100)


**** Panel B: SLR; Y = $/AF; X = Congressional Power Index
reg fundafy CPI if fundafy!=0, robust
  margins, at(CPI = (-5(5)25)) post
  estimates store fund1
  colorpalette FireBrick Gold, ipolate(100) nograph
  coefplot fund1, at recast(connected) mcolor("`r(p1)'") lcolor("`r(p5)'") ciopts(color("`r(p60)'%10" "`r(p58)'%10" "`r(p56)'%10" "`r(p54)'%10" "`r(p52)'%10" "`r(p50)'%10" "`r(p48)'%10" "`r(p46)'%10" "`r(p44)'%10" "`r(p42)'%10" "`r(p40)'%10" "`r(p38)'%10" "`r(p36)'%10" "`r(p34)'%10" "`r(p32)'%10" "`r(p30)'%10") recast(rarea rarea rarea rarea rarea rarea rarea rarea rarea rarea rarea rarea rarea rarea rarea rarea) lwidth(none none none none none none none none none none none none none none none none)) level(95 94 93 92 91 90 89 88 87 86 85 84 83 82 81 80) xlabel(-5(5)25, labsize(huge) labcolor(black)) ylabel(-4000(2000)4000, labsize(huge) labcolor(black) format(%9.0fc)) xtitle("Congressional Power Index", size(vhuge) margin(zero) color(black)) xsize(15) ysize(20) saving(fund1, replace) graphregion(margin(0 0 3 0)) title("(B)", ring(0) pos(11) margin(3 0 0 3) size(vhuge)) 
  

**** Panel C: SLR; Y = $/AF; X = Water Shortage (MCM/mo.)
reg fundafy d12t50c if fundafy!=0, robust
  margins, at(d12t50c = (0(1)5)) post
  estimates store fund2
  colorpalette FireBrick Gold, ipolate(100) nograph
  coefplot fund2, at recast(connected) mcolor("`r(p1)'") lcolor("`r(p5)'") ciopts(color("`r(p60)'%10" "`r(p58)'%10" "`r(p56)'%10" "`r(p54)'%10" "`r(p52)'%10" "`r(p50)'%10" "`r(p48)'%10" "`r(p46)'%10" "`r(p44)'%10" "`r(p42)'%10" "`r(p40)'%10" "`r(p38)'%10" "`r(p36)'%10" "`r(p34)'%10" "`r(p32)'%10" "`r(p30)'%10") recast(rarea rarea rarea rarea rarea rarea rarea rarea rarea rarea rarea rarea rarea rarea rarea rarea) lwidth(none none none none none none none none none none none none none none none none)) level(95 94 93 92 91 90 89 88 87 86 85 84 83 82 81 80) xlabel(0(1)5, labsize(huge) labcolor(black)) ylabel(-4000(2000)4000, labsize(huge) labcolor(black) format(%9.0fc)) xtitle("Water Shortage (MCM/mo.)", size(vhuge) margin(zero) color(black)) xsize(15) ysize(20) saving(fund2, replace) graphregion(margin(0 0 0 3) color(none)) title("(C)", ring(0) pos(11) margin(3 0 0 3) size(vhuge)) 

  
**** Panel D: SLR; Y = $/AF; X = Pre-Settlement AF/Acre
reg fundafy afAcrePre if fundafy!=0, robust
  margins, at(afAcrePre = (0(10)40)) post
  estimates store fund3
  colorpalette FireBrick Gold, ipolate(100) nograph
  coefplot fund3, at recast(connected) mcolor("`r(p1)'") lcolor("`r(p5)'") ciopts(color("`r(p60)'%10" "`r(p58)'%10" "`r(p56)'%10" "`r(p54)'%10" "`r(p52)'%10" "`r(p50)'%10" "`r(p48)'%10" "`r(p46)'%10" "`r(p44)'%10" "`r(p42)'%10" "`r(p40)'%10" "`r(p38)'%10" "`r(p36)'%10" "`r(p34)'%10" "`r(p32)'%10" "`r(p30)'%10") recast(rarea rarea rarea rarea rarea rarea rarea rarea rarea rarea rarea rarea rarea rarea rarea rarea) lwidth(none none none none none none none none none none none none none none none none)) level(95 94 93 92 91 90 89 88 87 86 85 84 83 82 81 80) xlabel(0(10)40, labsize(huge) labcolor(black)) ylabel(-4000(2000)4000, labsize(huge) labcolor(black) format(%9.0fc)) xtitle("AFY/Acre", size(vhuge) margin(zero) color(black)) xsize(15) ysize(20) saving(fund3, replace) graphregion(margin(0 0 3 0)) title("(D)", ring(0) pos(11) margin(3 0 0 3) size(vhuge))
  
  
**** Panel E: SLR; Y = $/AF; X = ID Urbanization Rate
reg fundafy urbanizeRate if fundafy!=0, robust
  margins, at(urbanizeRate = (0(20)100)) post
  estimates store fund4
  colorpalette FireBrick Gold, ipolate(100) nograph
  coefplot fund4, at recast(connected) mcolor("`r(p1)'") lcolor("`r(p5)'") ciopts(color("`r(p60)'%10" "`r(p58)'%10" "`r(p56)'%10" "`r(p54)'%10" "`r(p52)'%10" "`r(p50)'%10" "`r(p48)'%10" "`r(p46)'%10" "`r(p44)'%10" "`r(p42)'%10" "`r(p40)'%10" "`r(p38)'%10" "`r(p36)'%10" "`r(p34)'%10" "`r(p32)'%10" "`r(p30)'%10") recast(rarea rarea rarea rarea rarea rarea rarea rarea rarea rarea rarea rarea rarea rarea rarea rarea) lwidth(none none none none none none none none none none none none none none none none)) level(95 94 93 92 91 90 89 88 87 86 85 84 83 82 81 80) xlabel(0(20)100, labsize(huge) labcolor(black)) ylabel(-4000(2000)4000, labsize(huge) labcolor(black) format(%9.0fc)) xtitle("Urbanization (%)", size(vhuge) margin(zero) color(black)) xsize(15) ysize(20) saving(fund4, replace) graphregion(margin(0 0 0 3)) title("(E)", ring(0) pos(11) margin(3 0 0 3) size(vhuge)) 
  

graph combine fund1.gph fund2.gph , xsize(10) ysize(20) col(1) graphregion(margin(0 2 0 0)) saving(fundBC, replace)
graph combine fund3.gph fund4.gph , xsize(10) ysize(20) col(1) graphregion(margin(0 2 0 0)) saving(fundDE, replace) 
graph combine fundBC.gph fundDE.gph, col(3) xsize(20) ysize(15) graphregion(margin(tiny)) fxsize(140) fysize(100) saving(fundafy, replace) l1("$/AF", size(huge)) ycommon
graph combine fundpr.gph fundafy.gph, col(3) xsize(20) ysize(9) graphregion(margin(tiny))





**** Appendix Table A8: Probability of an ID Securing Settlement Funding
********************************************************************************
********************************************************************************

*** Column 1 (LASSO)
set seed 12
lasso logit prFund CPI urbanizeRate xlinPct d12t50c acres USBRpct hayAdj afAcrePre reslnprime UrbanGrowth, nolog 
qui di "`e(post_sel_vars)'"
logit `e(post_sel_vars)'

*** Columns 2-5 (Logit)
logit prFund CPI, robust
logit prFund urbanizeRate, robust
logit prFund d12t50c, robust
logit prFund afAcrePre, robust



**** Appendix Table A9: Probability of an ID Securing Settlement Funding 
**** Robustness check 1
********************************************************************************
********************************************************************************

logit prFund xlinPct, robust
logit prFund reslnprime, robust
logit prFund USBRpct, robust
logit prFund urbanizeRate, robust
logit prFund hayAdj, robust
logit prFund UrbanGrowth, robust



**** Appendix Table A10:  Probability of an ID Securing Settlement Funding 
**** Robustness check 2
********************************************************************************
********************************************************************************

logit prFund CPI afAcrePre, robust
logit prFund CPI urbanizeRate, robust
logit prFund CPI afAcrePre urbanizeRate, robust
logit prFund CPI afAcrePre d12t50c, robust
logit prFund urbanizeRate d12t50c, robust
logit prFund afAcrePre d12t50c, robust
logit prFund afAcrePre urbanizeRate d12t50c, robust



**** Appendix Table A11:  Relationship between Bargaining Power and $/AF 
********************************************************************************
********************************************************************************

reg fundafy_nz CPI, robust
reg fundafy_nz d12t50c, robust
reg fundafy_nz afAcrePre, robust
reg fundafy_nz urbanizeRate, robust


**** Appendix Table A12:  Relationship between Bargaining Power and $/AF 
**** Robustness check 1 
********************************************************************************
********************************************************************************

reg fundafy_nz xlinPct, robust
reg fundafy_nz reslnprime, robust
reg fundafy_nz USBRpct, robust
reg fundafy_nz hayAdj, robust
reg fundafy_nz UrbanGrowth, robust


